/*
 * CommunicationADP.h
 *
 *  
 */

#ifndef COMMUNICATIONADP_H_
#define COMMUNICATIONADP_H_

#include "MiddlewareCommon.h"
#include "../IPC/SharedMemoryInterface.h"
#include "../IPC/MessageQueue.h"

#define ADP_TIPO_PRODUCCION 1
#define ADP_TIPO_GABINETES 2

namespace middleware {

class CommunicationADP {
public:
	typedef enum{ADP=0,VENDEDOR, UNDEFINED_TYPE}ADPCommunicationType;

	CommunicationADP(std::string hostName);
	virtual ~CommunicationADP();

	void producir(ProductoCantidad &productos);
	ProductoCantidad obtenerAProducir();
	//launcher
	static void create(ADPCommunicationType type = UNDEFINED_TYPE, std::string hostName= "");
	static void destroy(ADPCommunicationType type = UNDEFINED_TYPE, std::string hostName = "");

private:
	ipc::MessageQueue<ProductoCantidad> colaRecepcion;
	static const Uid UID;
	int mtypeRecepADP;
};

} /* namespace middleware */
#endif /* COMMUNICATIONADP_H_ */
